// pages/show/show.js

const DB = wx.cloud.database()

Page({
  data: {
    dataDB:""
  },

  onLoad:function(){
    DB.collection("user")
    .get({
      success:res=>{
        //console.log(res.data.length)
        if(res.data.length != 0){
          this.setData({
            dataDB:res.data
          })
        }
        else{
          wx.showModal({
            title: '提示',
            content: '暂无乘车记录',
            showCancel: false,
            confirmText: '返回',
            success: function(res) {
              wx.navigateBack({
                url:'/pages/index/index'
              });
            }
        });
        }
      }
    })
  }
})